Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

support for loading Google credentials from environment file #17

Merged
merged 3 commits into from
Jun 5, 2017

Conversation

mattnworb
Copy link
Member

@mattnworb mattnworb commented Jun 5, 2017

Adds support for loading Google credentials from the environment variable DOCKER_GOOGLE_CREDENTIALS if it is set and points to a readable file.

If not set, then the Google Application Default Credentials are still used as before (if they can be loaded).

This PR also includes a change to use authentication info from the docker-cli config file, which in turn depends on some not-yet-released changes in docker-client (see spotify/docker-client#775). This will resolve a number of open issues in this repository around a lack of authentication support.

The build will fail until spotify/docker-client#775 is complete and released, but I wanted to create the PR now to start the review process.

In the cases where Google credentials are available, use those with higher precedence than the config file.

@mattnworb
Copy link
Member Author

@mattnworb mattnworb force-pushed the mattbrown/gcr-environment-variable branch from b5efd7c to 9901515 Compare June 5, 2017 14:49
@caipre
Copy link

caipre commented Jun 5, 2017

👍

mattnworb added 2 commits June 5, 2017 12:43
Build the DockerClient instance so that it always uses the new
ConfigFileRegistryAuthSupplier (from docker-client 8.6.3) to support any
auth info in the docker config file.

In the cases where Google credentials are available, use those with
higher precedence than the config file.
Adds support for loading Google credentials from the environment
variable DOCKER_GOOGLE_CREDENTIALS if it is set and points to a readable
file.

If not set, then the Google Application Default Credentials are still
used as before.
@mattnworb mattnworb force-pushed the mattbrown/gcr-environment-variable branch from 0449624 to 67548e1 Compare June 5, 2017 16:43
@mattnworb
Copy link
Member Author

@davidxia @caipre - I added a note to the README documenting the auth support - please take another look.

@mattnworb mattnworb force-pushed the mattbrown/gcr-environment-variable branch 5 times, most recently from 7932b55 to 7e91058 Compare June 5, 2017 19:23
@davidxia davidxia force-pushed the mattbrown/gcr-environment-variable branch from 7e91058 to e901d0e Compare June 5, 2017 19:52
@mattnworb mattnworb merged commit f03963e into master Jun 5, 2017
@mattnworb mattnworb deleted the mattbrown/gcr-environment-variable branch June 5, 2017 20:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants